package com.site.service.impl;

import com.site.dao.EmployeeRoleDao;
import com.site.dao.impl.EmployeeRoleDaoImpl;
import com.site.pojo.EmployeeRole;
import com.site.service.EmployeeRoleService;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public class EmployeeRoleServiceImpl implements EmployeeRoleService {
    private EmployeeRoleDao employeeRoleDao = new EmployeeRoleDaoImpl();
    @Override
    public List<EmployeeRole> selectAll() throws SQLException {
        return employeeRoleDao.selectAll();
    }

    @Override
    public EmployeeRole selectById(EmployeeRole emp) throws SQLException {
        return employeeRoleDao.selectById(emp);
    }

    @Override
    public boolean addEmployeeRole(Connection con, EmployeeRole employeeRole) throws SQLException {
        return employeeRoleDao.addEmployeeRole(con,employeeRole)>0?true:false;
    }

    @Override
    public boolean delEmployeeRole(Connection con, EmployeeRole employeeRole) {
        return employeeRoleDao.delEmployeeRole(con,employeeRole)>0?true:false;
    }

    @Override
    public boolean updateEmployeeRole(Connection con, EmployeeRole employeeRole) {
        return employeeRoleDao.updateEmployeeRole(con,employeeRole)>0?true:false;
    }
}
